{% load i18n %}
<div class="layui-col-md12" style="margin-bottom: 10px;">
    <div class="layui-input-inblock">
      <select name="pro_id" lay-verify="required"  lay-filter="project" id="project">
        <option value="{{ project.id }}">{{ project.name }}</option>
      </select>
    </div>
</div>

<div class="layui-row">
    <div class="layui-col-md12" style="margin-bottom: 10px;">
        <span>点击文档树选择上级（可选）或</span>
        <button class="layui-btn layui-btn-xs layui-btn-primary" id="clearParentDoc">取消上级</button>
        <input type="text" id="parent-doc" hidden> 
    </div>
    <div class="layui-col-md12">
        <input type="number" class="layui-input" placeholder="输入文档排序值，默认99" id="sort" value="{{doc.sort}}">
    </div>
</div>

<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">文档结构树</h2>
        <div class="layui-colla-content layui-show" style="max-height: 400px;overflow: hidden;overflow-y: scroll;overflow-x: scroll;">
            <div id="doc-tree"></div>
        </div>
    </div>
</div>
<hr>

<!-- 标签输入框 -->
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">标签</h2>
        <div class="layui-colla-content layui-show">
            <div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
                <input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="{{doc_tags}}" placeholder="输入标签名">
            </div>
        </div>
    </div>
</div>

<!-- 文档下级目录展开设置 -->
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">下级目录</h2>
        <div class="layui-colla-content layui-show">
            <div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
                {%if doc.open_children %}
                <input type="radio" name="open-children" value="true" title="展开" checked>
                <input type="radio" name="open-children" value="false" title="收起">
                {% else %}
                <input type="radio" name="open-children" value="true" title="展开">
                <input type="radio" name="open-children" value="false" title="收起" checked>
                {% endif %}
            </div>
        </div>
    </div>
</div>

<!-- 发布按钮 -->
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">发布</h2>
        <div class="layui-colla-content layui-show">
            <div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
                <div class="layui-row" style="margin-top: 5px;">
                    <button class="layui-btn layui-btn-primary layui-btn-fluid mrdoc-btn-default" id="modify_save_doc" title="保存当前内容为草稿文档">
                        <i class="fa fa-save"></i> 保存为草稿
                    </button>
                </div>
        
                <div class="layui-row" style="margin-top: 5px;">
                    <button class="layui-btn layui-btn-normal layui-btn-fluid" id="modify_pub_doc" title="发布当前内容">
                        <i class="fa fa-save"></i> 发布文档
                    </button>
                </div>
        
                <div class="layui-row" style="margin-top: 5px;">
                    <button class="layui-btn layui-btn-warm layui-btn-fluid" onclick="moveDoc()" title="复制或移动此文档到其他文集"><i class="fa fa-copy"></i> 复制/移动文档</button>
                </div>
            
                <div class="layui-row" style="margin-top: 5px;">
                    <button class="layui-btn layui-btn-danger layui-btn-fluid" onclick="delDoc()" title="删除此文档"><i class="fa fa-trash"></i> 删除文档</button>
                </div>
            </div>
        </div>
    </div>
</div>